Skip to content

oslayer: Make wmctrl optional (for Wayland).#1832

Open
daym wants to merge 1 commit intoopensteno:mainfrom
daym:wmctrl-wayland
Open

oslayer: Make wmctrl optional (for Wayland).#1832
daym wants to merge 1 commit intoopensteno:mainfrom
daym:wmctrl-wayland

Conversation

@daym
Copy link

@daym daym commented Mar 23, 2026

Summary of changes

Make wmctrl optional (for Wayland--otherwise plover crashes on startup).

Closes

Pull Request Checklist

  • Changes have tests
  • News fragment added in news.d. See documentation for details

@mkrnr
Copy link
Contributor

mkrnr commented Mar 25, 2026

Thanks a lot for your PR!

Ruff is complaining right now. I'd suggest something like this:

from .display_server import DISPLAY_SERVER


def GetForegroundWindow():
    return None


def SetForegroundWindow(w):
    del w


if DISPLAY_SERVER == "x11":
    from .wmctrl_x11 import WmCtrl

    _wmctrl = WmCtrl()
    GetForegroundWindow = _wmctrl.get_foreground_window
    SetForegroundWindow = _wmctrl.set_foreground_window

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants